@extends('backend::layout')
@section('title',$page_title)
@section('content')
    @component('backend::component.table.table-content')
        @slot('page_title'){{$page_title}}@endslot
        @slot('tools_btn')
            @component('backend::component.form.button')
                @slot('elem') a @endslot
                @slot('title')添加广告位@endslot
                @slot('icon') hcl-currency-add @endslot
                @slot('size') sm @endslot
                @slot('href') {{route('d_AdPos_create')}} @endslot
            @endcomponent
            @component('backend::component.form.button')
                @slot('title') 删除 @endslot
                @slot('btn') btn @endslot
                @slot('color') danger @endslot
                @slot('icon') hcl-remove @endslot
                @slot('class') btn-ajax mr-1 @endslot
                @slot('params')
                    {"url":"{{route('d_AdPos_delete')}}","method":"post","title":"批量删除","targetData":".id","confirm":"true"}
                @endslot
            @endcomponent
        @endslot
        @slot('body_content')
            @if($list->isNotEmpty())
                <table class="table table-striped table-bordered">
                    <thead><tr>
                        <th>
                            @component('backend::component.checkbox')
                                @slot('name') ids-all @endslot
                            @endcomponent
                        </th>
                        <th>位置名称</th><th>位置大小</th><th>广告数量</th><th>终端类型</th><th>状态</th><th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($list as $value)
                        <tr>
                            <td>
                                @component('backend::component.checkbox')
                                    @slot('name') id[] @endslot
                                    @slot('class') id @endslot
                                    @slot('value') {{$value->id}} @endslot
                                @endcomponent
                            </td>
                            <td>{{$value->pos_name}}</td>
                            <td>
                                宽:{{$value->ad_width}},高{{$value->ad_height}}
                            </td>
                            <td>{{$value->ad_number}}</td>
                            <td>{{config('app.client_type')[$value->client_type]}}</td>
                            <td>
                                @component("backend::component.switch")
                                    @slot('params'){"url":"{{route('d_AdPos_switchAdPos',['id'=>$value->id])}}"} @endslot
                                    @slot('checked') @if($value->status == 1) checked @endif @endslot
                                @endcomponent
                            </td>
                            <td>
                                @component('backend::component.form.button')
                                    @slot('elem') a @endslot
                                    @slot('icon') hcl-edit1 @endslot
                                    @slot('size') sm @endslot
                                    @slot('color') info @endslot
                                    @slot('href') {{route('d_AdPos_update',['id'=>$value->id])}} @endslot
                                @endcomponent

                                @component('backend::component.form.button')
                                    @slot('color') danger @endslot
                                    @slot('icon') hcl-remove @endslot
                                    @slot('size') sm @endslot
                                    @slot('class') btn-ajax @endslot
                                    @slot('params') {"url":"{{route('d_AdPos_delete',['id'=>$value->id])}}","title":"删除广告位","confirm":"true"} @endslot
                                @endcomponent
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
                @slot('list_page')
                    {{$list->appends($search_tpl->getSearchData())->links('backend::public.pagination')}}
                @endslot
            @else
                @component('backend::public.empty_page')
                    @slot('info') 暂时没有变更类型 @endslot
                @endcomponent
            @endif
        @endslot
    @endcomponent
@endsection